package model;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the VENDOR database table.
 * 
 */
@Entity
public class Vendor implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="VENDOR_ID")
	private long vendorId;

	private String city;

	private String fax;

	private String name;

	private String phone;

	@Column(name="POSTAL_CODE")
	private String postalCode;

	@Column(name="\"STATE\"")
	private String state;

	@Column(name="STREET_ADDRESS")
	private String streetAddress;

	@Column(name="TAX_ID")
	private String taxId;

	@Column(name="VENDOR_CONTACT")
	private String vendorContact;

	//bi-directional many-to-one association to Supply
	@OneToMany(mappedBy="vendor")
	private List<Supply> supplies;

	public Vendor() {
	}

	public long getVendorId() {
		return this.vendorId;
	}

	public void setVendorId(long vendorId) {
		this.vendorId = vendorId;
	}

	public String getCity() {
		return this.city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getFax() {
		return this.fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPostalCode() {
		return this.postalCode;
	}

	public void setPostalCode(String postalCode) {
		this.postalCode = postalCode;
	}

	public String getState() {
		return this.state;
	}

	public void setState(String state) {
		this.state = state;
	}

	public String getStreetAddress() {
		return this.streetAddress;
	}

	public void setStreetAddress(String streetAddress) {
		this.streetAddress = streetAddress;
	}

	public String getTaxId() {
		return this.taxId;
	}

	public void setTaxId(String taxId) {
		this.taxId = taxId;
	}

	public String getVendorContact() {
		return this.vendorContact;
	}

	public void setVendorContact(String vendorContact) {
		this.vendorContact = vendorContact;
	}

	public List<Supply> getSupplies() {
		return this.supplies;
	}

	public void setSupplies(List<Supply> supplies) {
		this.supplies = supplies;
	}

	
	public Supply addSupplies(Supply supplies) {
		getSupplies().add(supplies);
		supplies.setVendor(this);

		return supplies;
	}

	public Supply removeSupplies(Supply supplies) {
		getSupplies().remove(supplies);
		supplies.setVendor(null);

		return supplies;
	}
}